
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
    <head>
        <sj:head/>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Conference Bookings</title>

        <script src="js/jquery.cookie.js"></script>
        <script src="js/coms.js"></script>
    </head>
    <body>
        <s:include value="/jsp/header.jsp">
            <s:param name="user" value="#session.user.username" />
        </s:include>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span3">
                    <s:action name="selectMenu" executeResult="true"/>
                </div>
                <div class="span9">
                    <div class="hero-unit">

                        <s:form action="cancelConferenceBooking" >
                            <table align="center" cellspacing="7">                   
                                <tr>
                                    <td colspan="5">
                                        <h2>Booked Conferences</h2>
                                        <hr/>
                                    </td>
                                </tr>
                                <s:iterator value="registeredConferenceList" var="conf">
                                    <tr>                                        
                                        <td colspan="4"><h3><s:property value="#conf.conference.name" /></h3></td>
                                        <td><s:if test="#conf.valid">
                                            
                                                <input type="submit" name="cancel[<s:property value='#conf.id'/>]" value="Cancel Booking" /> 
                                            
                                        </s:if>
                                        <s:else>
                                            Canceled Booking
                                        </s:else>
                                                </td>
                                    </tr>
                                    <tr>                                        
                                        <td colspan="4"><h4><s:property value="#conf.conference.detail" /></h4></td>                            
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td align="justify">Booking Date</td><td>:</td>
                                        <td td colspan="3"><s:property value="#conf.registrationDate" /></td>
                                    <tr>
                                    <tr>
                                        <td align="justify">Address</td><td>:</td>
                                        <td td colspan="2"><s:property value="#conf.conference.location" /></td>                            
                                        <td></td>
                                    </tr>
                                    
                                    <tr>
                                        <td align="justify">Cost</td><td>:</td>
                                        <td td colspan="3">S$ <s:property value="#conf.conference.cost" /></td>                            
                                    </tr>
                                    
                                    <tr>
                                        <td align="justify">Payment Status</td><td>:</td>
                                        <td>
                                            <s:if test="#conf.paymentStatus">Paid</s:if>                                
                                            <s:else>Payment Pending</s:else>
                                        </td>                            
                                        <td></td>
                                        <td>                       
                                            <s:if test="#conf.paymentStatus && #conf.valid">                                                                                    
                                                <s:a href="%{id}GenerateInvoiceAction" requestType="GET">Invoice</s:a>
                                            </s:if>
                                            <s:elseif test="#conf.valid">
                                                <s:a href="paymentConferenceBooking%{id}" requestType="GET">Make Payment</s:a>
                                            </s:elseif>
                                        </td>                                                            
                                    </tr>                    
                                    <tr>
                                        <td colspan="5">
                                            <hr/>
                                        </td>
                                    </tr>
                                </s:iterator>
                            </table>

                        </s:form>

                    </div>
                    <div class="row-fluid">

                    </div>
                </div>
            </div>
        </div>
        <s:include value="/jsp/footer.jsp"/>
    </body>
</html>
